package com.lzj.server.utils;

import org.jetbrains.annotations.NotNull;

/**
 * @author Lzj
 * 封装ThreadLocal
 */
public class BaseContext {
    private static final ThreadLocal<Long> userThreadLocal = new ThreadLocal<>();

    // 添加
    public static void set(Object id) {
        userThreadLocal.set(Long.valueOf(id.toString()));
    }

    // 获取
    public static Long get() {
        return userThreadLocal.get();
    }

    // 删除
    public static void remove() {
        userThreadLocal.remove();
    }
}

